home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / gnu-c / etc / ksh.kshrc (.txt) next >
Microsoft Windows Help File Content  |  1994-07-24  |  2KB  |  75 lines

  1. # NAME:
  2. #    ksh.kshrc - global initialization for ksh 
  3. # DESCRIPTION:
  4. #    Each invocation of /bin/ksh processes the file pointed
  5. #    to by $ENV (usually $HOME/.kshrc).
  6. #    This file is intended as a global .kshrc file for the
  7. #    Korn shell.  A user's $HOME/.kshrc file simply requires
  8. #    the line:
  9. #        . /etc/ksh.kshrc
  10. #    at or near the start to pick up the defaults in this
  11. #    file which can then be overridden as desired.
  12. # SEE ALSO:
  13. #    $HOME/.kshrc
  14. # RCSid:
  15. #    $Id: ksh.kshrc,v 1.2 1992/04/27 07:09:28 sjg Exp $
  16. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  17. #    This file is provided in the hope that it will
  18. #    be of use.  There is absolutely NO WARRANTY.
  19. #    Permission to copy, redistribute or otherwise
  20. #    use this file is hereby granted provided that 
  21. #    the above copyright notice and this notice are
  22. #    left intact. 
  23. case "$-" in
  24. *i*)    # we are interactive
  25.     # we may have su'ed so reset these
  26.     # NOTE: SCO-UNIX doesn't have whoami,
  27.     #    install whoami.sh
  28.     USER=`whoami`
  29.     PROMPT="<$USER@$HOSTNAME:!>$ "
  30.     PPROMPT='<$USER@$HOSTNAME:$PWD:!>$ '
  31.     PS1=$PPROMPT
  32.     # $TTY is the tty we logged in on,
  33.     # $tty is that which we are in now (might by pty)
  34.     tty=`tty`
  35.     tty=`basename $tty`
  36.     set -o ${FCEDIT:-$EDITOR}
  37.     # the PD ksh is not 100% compatible
  38.     case "$KSH_VERSION" in
  39.     *PD*)    # PD ksh
  40.             bind ^?=delete-char-backward
  41.             bind ^[^?=delete-word-backward
  42.     *)    # real ksh ?
  43.     esac
  44.     case "$TERM" in
  45.     sun*)
  46.         if [ "$tty" != console ]; then
  47.             ILS='\033]L'; ILE='\033\\'
  48.             WLS='\033]l'; WLE='\033\\'
  49.     xterm*)
  50.         ILS='\033]1;'; ILE='\007'
  51.         WLS='\033]2;xterm: '; WLE='\007'
  52.     *)    ;;
  53.     esac
  54.     # do we want window decorations?
  55.     if [ "$ILS" ]; then
  56.         wftp () { ilabel "ftp $*"; "ftp" $*; ilabel "$USER@$HOSTNAME"; }
  57.         wcd () { "cd" $*; eval stripe; }
  58.         ilabel () { print -n "${ILS}$*${ILE}"; }
  59.         label () { print -n "${WLS}$*${WLE}"; }
  60.         alias stripe='label $USER @ $HOSTNAME \($tty\) - $PWD'
  61.         alias cd=wcd
  62.         alias ftp=wftp
  63.         eval stripe
  64.         eval ilabel "$USER@$HOSTNAME"
  65.         PS1=$PROMPT
  66.     alias ls='ls -aCF'
  67.     alias h='fc -l | more'
  68.     alias quit=exit
  69.     alias cls=clear
  70.     alias logout=exit
  71.     alias bye=exit
  72. # add your favourite aliases here
  73. *)    # non-interactive
  74. # commands for both interactive and non-interactive shells
  75.